//
//  ABViewController.swift
//  ABNavigation
//
//  Created by FaiWong on 2023/2/26.
//

import UIKit

public class ABViewController: UIViewController {
    var statusBarStyle:UIStatusBarStyle = .default
    var customNav:ABNavigationBar?
    public override func viewDidLoad() {
        super.viewDidLoad()

        self.isVisableNavigationBar = true
        self.extendedLayoutIncludesOpaqueBars = false
        self.edgesForExtendedLayout = []

        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor(hexStr: "f3f3f2")
    }
    
    func setCustomNav(conf:ABNavigationBarConfig) {
        self.isVisableNavigationBar = false
        if statusBarStyle == .lightContent {
            conf.titleColor = UIColor.white
        }
        
        self.customNav = ABNavigationBar(frame: CGRect(x: 0, y: 0, width: self.view.width_ab, height: kStatusBarHeight+44.0))
        self.customNav?.setData(conf: conf)
        self.view.addSubview(self.customNav!)
    }
    
    deinit {
        print("applog: \(self.classForCoder) dealloc")
    }
}
